{{>partial_header}}

from setuptools import setup, find_packages  # noqa: H301

NAME = "{{{projectName}}}"
VERSION = "{{packageVersion}}"
{{#apiInfo}}
{{#apis}}
{{#-last}}
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

PYTHON_REQUIRES = ">=3.7"
REQUIRES = [
    "urllib3 >= 1.25.3, < 3.0.0",
    "python-dateutil",
    "pydantic >= 1.10.5",
    "aenum"
]

with open('README.md') as f:
    import re
    # replace relative links with links to the docs:
    doc_version = '.'.join(f'v{VERSION}'.split('.')[:2])
    long_description = re.sub(r'(\[[*a-zA-Z_]*]\()docs/([A-Za-z0-9]*)\.md',
                       rf'\1https://pydocs-sdk.lakefs.io/{doc_version}/docs/\2.html',
                       f.read())

setup(
    name=NAME,
    version=VERSION,
    description="{{appName}}",
    author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}",
    author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}",
    url="{{packageUrl}}",
    keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"],
    python_requires=">=3.6",
    install_requires=REQUIRES,
    packages=find_packages(exclude=["test", "tests"]),
    include_package_data=True,
    {{#licenseInfo}}license="{{.}}",
    {{/licenseInfo}}long_description=long_description,
    long_description_content_type='text/markdown'
)
{{/-last}}
{{/apis}}
{{/apiInfo}}
